Repository navigation
Conversation
Round 5 review found several places that cut a line before hiding the
typed text, so a cut could keep a piece of it that no match then found.
- Helper: clip() takes the run's secret and hides it before cutting, so
every control description, tab title, page text, surface and popup
passes through one redact-then-clip path; every question set goes out
through ask(), which scrubs state and questions.
- Server: redactThenClip/redactThenCap replace clip-then-hide in task
ends, host events, refusals and approval bindings; readerBinding
redacts every optional action field; clipped echoes whose cut ends in
a prefix of the typed text count as echoes.
- Quoted labels exempt short text only when {text} stands outside short
label-only quotes, and word boundaries apply only at alphanumeric ends.
Tests run a long, prefixed, mixed-case secret through the decider,
snapshots, status, audit and errors, cover the quoted-label cases, and
guard a decision raced against an in-flight type approval.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #288, which was merged before Randy's round-5 review of 82f4844ab. Every remaining leak followed one pattern: a line was clipped, capped or sliced before the typed text was hidden. A cut could then keep part of a long or prefixed secret that the matcher no longer recognised.
Fix
Redaction now always happens before a line is cut, and a single helper on each side enforces that:
controller.ts):clip()takes the run's secret and hides it before it cuts, so the type checker makes every caller pass it. This covers control descriptions, tab titles,visibleText, the surface, the reused tab, popups and choose_file. Every question set leaves throughask(), which scrubs the state and the questions, includingchooseSurface's.ComputerService.ts):redactThenClip/redactThenCapreplace the clip-then-hide order in:finishTaskreason and surfacehostEventhowand step texterrorauthorizeStepbuilds the reader and audit bindings from the full app/title/url before capping them.readerBindingredacts every optional action field exceptkindandtext.echoes()now drops a clipped echo when the end of the cut matches the start of the typed text (Bearer <secret>…).{text}appears outside short, label-only quotes (40 characters or fewer, no mixed quote types). Word boundaries apply only when the typed text starts or ends with a letter or digit, soa.,4and!1are refused.Tests
These three fail on main and pass with the fix:
Bearerechoes, never reaches the decider (state and questions), the reader or approver snapshots,status(what the MCP tools read), the audit file or the host refusal error.{text}appears only inside quotes, a long quoted span, mixed quotes, anda./4/!1.The race test (a
hostDeciderefused while atypeapproval is in flight, then redacted once it is granted) passes on main too. It's a regression guard, not proof of a bug.Verification
vp test run:vp run check:changed origin/main: all passing.Done by Claude Opus 5.5 in Claude Code (Ada agent Doug).
🤖 Generated with Claude Code